<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>自定义导航页</title>
    <link rel="icon" href="icon.jpg" type="image/jpeg">
    <link rel="stylesheet" href="style.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
</head>
<body>
    <div class="container">
        <header>
            <div class="title-section">
                <img src="icon.jpg" alt="Logo" class="logo" id="siteLogo">
                <h1 id="pageTitle">我的导航页</h1>
                <button class="edit-title-btn" id="editTitleBtn" title="编辑标题">
                    <i class="fas fa-edit"></i>
                </button>
            </div>
            <div class="header-buttons">
                <button class="refresh-btn" id="refreshBtn" title="刷新所有图标">
                    <i class="fas fa-sync-alt"></i>
                    刷新图标
                </button>
                <button class="export-btn" id="exportBtn" title="导出书签数据">
                    <i class="fas fa-download"></i>
                    导出数据
                </button>
                <button class="import-btn" id="importBtn" title="导入书签数据">
                    <i class="fas fa-upload"></i>
                    导入数据
                </button>
                <button class="add-btn" id="addBtn">
                    <i class="fas fa-plus"></i>
                    添加网址
                </button>
            </div>
            <input type="file" id="importFile" accept=".json" style="display: none;">
        </header>

        <main>
            <div class="categories" id="categories">
                <div class="category" data-category="default">
                    <h2>默认分类</h2>
                    <div class="bookmarks" id="defaultBookmarks">
                        <!-- 网址卡片将在这里显示 -->
                    </div>
                </div>
            </div>
        </main>
        
        <footer class="footer">
            <p>Copyright © 2025 yangjifang_ruby</p>
        </footer>
    </div>

    <!-- 添加网址模态框 -->
    <div class="modal" id="addModal">
        <div class="modal-content">
            <div class="modal-header">
                <h3>添加新网址</h3>
                <span class="close" id="closeModal">&times;</span>
            </div>
            <div class="modal-body">
                <form id="addBookmarkForm">
                    <div class="form-group">
                        <label for="bookmarkName">网站名称:</label>
                        <input type="text" id="bookmarkName" required placeholder="请输入网站名称">
                    </div>
                    <div class="form-group">
                        <label for="bookmarkUrl">网站链接:</label>
                        <input type="url" id="bookmarkUrl" required placeholder="https://example.com">
                    </div>
                    <div class="form-group">
                        <label for="bookmarkCategory">分类:</label>
                        <select id="bookmarkCategory">
                            <option value="default">默认分类</option>
                        </select>
                        <input type="text" id="newCategory" placeholder="或创建新分类">
                    </div>
                    <div class="form-actions">
                        <button type="button" id="cancelBtn">取消</button>
                        <button type="submit" id="saveBtn">保存</button>
                    </div>
                </form>
            </div>
        </div>
    </div>

    <!-- 右键菜单 -->
    <div class="context-menu" id="contextMenu">
        <div class="menu-item" id="editBookmark">
            <i class="fas fa-edit"></i> 编辑
        </div>
        <div class="menu-item" id="deleteBookmark">
            <i class="fas fa-trash"></i> 删除
        </div>
    </div>

    <script src="https://cdnjs.cloudflare.com/ajax/libs/Sortable/1.15.0/Sortable.min.js"></script>
    <script src="script.js"></script>
</body>
</html>